﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EnterApp.Core.DomainModel;
using OnlyMusic.DomainModel.Entities;
using OnlyMusic.DomainModel.Services;

namespace OnlyMusic.DomainModel.Roles
{
    public class Uploader : Role<Account, UniqueId>, IUploader
    {
        private ISongManagerService songManager = new SongManagerService();

        public Uploader(Account account)
            : base(account)
        {
            if (account.IsLocked)
            {
                throw new NotSupportedException("Locked account is not allowed to act as borrower.");
            }
        }

        public bool Upload(Song song, byte[] content)
        {
            return songManager.Upload(song, this, content);
        }
    }
}
